<template>
  <div style="padding: 30px ; width: 80%">
    <div style="margin-bottom: 30px">新增用户 </div>
    <el-form :inline="true" :model="form" lable-width="100px">
      <el-form-item label="用户名">
        <el-input v-model="form.username" placeholder="请输入姓名"></el-input>
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="form.password" placeholder="请输入密码"></el-input>
      </el-form-item>
      </el-form>
  <div style="text-align: left; margin-top: 30px">
    <el-button type="primary" @click="save" size="medium">提交</el-button>
<!--    <el-button type="danger"></el-button>-->
  </div>

  </div>
</template>

<script>
import request from '@/utils/request';

export default {
  name: 'AddUser',
  data() {
    return {
      form:{}
    }
  },
  methods:{
  save(){
    request.post('/user/save',this.form).then(res=>{
      if(res.code==200){
        this.$notify.success('新增成功')
      }else{
        this.$notify.error(res.msg)
      }
    })
    }
  }
}
</script>
